#ifndef __DYNAMICARRAY_H_
#define __DYNAMICARRAY_H_

class DynamicArray
{
public:
using ElementType= int;

    DynamicArray();
    void InsertTail(const ElementType& element);
    void show();
    ~DynamicArray();
    //拷贝构造 赋值运算符重载
    DynamicArray(const DynamicArray& s);
    void operator = (const DynamicArray &s);
    //查找
    ElementType FindByElement(DynamicArray *array, ElementType element);
    //删除
    void RemoveByIndex(DynamicArray *array,int index);
    void RemoveByElement(DynamicArray *array, ElementType element);
    //排序
    void FastSort(ElementType *a, int start, int end);
    void Sort(DynamicArray *a);
    //二分
    ElementType BinarySearch(ElementType *a, int size, int element);
    ElementType Search(DynamicArray *a, ElementType number);

private:
    ElementType *a;
    int m_capacity;
    int m_size;
};


#endif